소스 검색

Look for only non-promotional payment methods in new bubble script

pull/16/head
Kristijan Mitrovic 4 년 전
부모
커밋
2326faa6e2
1개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. +10
    -8
      bubble-server/src/test/resources/models/include/new_bubble.json

+ 10
- 8
bubble-server/src/test/resources/models/include/new_bubble.json 파일 보기

@@ -111,13 +111,13 @@

{
"comment": "list all payment methods",
"request": { "uri": "me/paymentMethods?all=true" },
"request": { "uri": "me/paymentMethods" },
"response": { "store": "paymentMethods" }
},

{
"comment": "add payment method for the user",
"onlyIf": "len(paymentMethods) == 0",
"onlyIf": "!match_any(paymentMethods, function(m) { return !m.hasPromotion() && m.getPaymentMethodType() != `promotional_credit`; })",
"before": "stripe_tokenize_card",
"request": {
"uri": "me/paymentMethods",
@@ -127,15 +127,15 @@
},

{
"comment": "list all payment methods again after creating one",
"onlyIf": "len(paymentMethods) == 0",
"request": { "uri": "me/paymentMethods?all=true" },
"response": { "store": "paymentMethods", "check": [{ "condition": "len(json) == 1" }] }
"comment": "wait for the one created above and fetch all payment methods again including that one",
"onlyIf": "!match_any(paymentMethods, function(m) { return !m.hasPromotion() && m.getPaymentMethodType() != `promotional_credit`; })",
"before": "await_url me/paymentMethods 5m 10s match_any(await_json, function(m) { return !m.hasPromotion() && m.getPaymentMethodType() != `promotional_credit`; })",
"request": { "uri": "me/paymentMethods" },
"response": { "store": "paymentMethods" }
},

{
"comment": "add plan, using the first found payment method for the new bubble",
"before": "sleep 24s",
"request": {
"uri": "me/plans",
"method": "put",
@@ -147,7 +147,9 @@
"plan": "<<plan>>",
"footprint": "<<footprint>>",
"sendMetrics": <<sendMetrics>>,
"paymentMethodObject": { "uuid": "{{ paymentMethods.[0].uuid }}" }
"paymentMethodObject": {
"uuid": "{{ js '_find(paymentMethods, function(m) { return !m.hasPromotion() && m.getPaymentMethodType() != `promotional_credit`; }).getUuid()' }}"
}
}
},
"response": { "store": "plan" }


불러오는 중...
취소
저장