Class: GoCardlessPro::Services::ScenarioSimulatorsService
- Inherits:
-
BaseService
- Object
- BaseService
- GoCardlessPro::Services::ScenarioSimulatorsService
- Defined in:
- lib/gocardless_pro/services/scenario_simulators_service.rb
Overview
Service for making requests to the ScenarioSimulator endpoints
Instance Method Summary collapse
-
#run(identity, options = {}) ⇒ Object
Runs the specific scenario simulator against the specific resource Example URL: /scenario_simulators/:identity/actions/run.
Methods inherited from BaseService
#initialize, #make_request, #sub_url
Constructor Details
This class inherits a constructor from GoCardlessPro::Services::BaseService
Instance Method Details
#run(identity, options = {}) ⇒ Object
Runs the specific scenario simulator against the specific resource Example URL: /scenario_simulators/:identity/actions/run
One of:
creditor_verification_status_action_required: Sets a creditor'sverification statustoaction required, meaning that the creditor must provide further information to GoCardless in order to verify their account to receive payouts.creditor_verification_status_in_review: Sets a creditor'sverification statustoin review, meaning that the creditor has provided all of the information requested by GoCardless to verify their account, and is now awaiting review.creditor_verification_status_successful: Sets a creditor'sverification statustosuccessful, meaning that the creditor is fully verified and can receive payouts.payment_confirmed: Transitions a payment through toconfirmed. It must start in thepending_submissionstate, and its mandate must be in theactivatedstate (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may bepending_submission, since their mandates are submitted with their first payment).payment_paid_out: Transitions a payment through topaid_out, having been collected successfully and paid out to you. It must start in thepending_submissionstate, and its mandate must be in theactivatedstate (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may bepending_submission, since their mandates are submitted with their first payment).payment_failed: Transitions a payment through tofailed. It must start in thepending_submissionstate, and its mandate must be in theactivatedstate (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may bepending_submission, since their mandates are submitted with their first payment).payment_charged_back: Behaves the same as thepayout_paid_outsimulator, except that the payment is transitioned tocharged_backafter it is paid out, having been charged back by the customer.payment_chargeback_settled: Behaves the same as thepayment_charged_backsimulator, except that the charged back payment is additionally included as a debit item in a payout, thereby settling the charged back payment.payment_late_failure: Transitions a payment through tolate_failure, having been apparently collected successfully beforehand. It must start in either thepending_submissionorpaid_outstate, and its mandate must be in theactivatedstate (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may bepending_submission, since their mandates are submitted with their first payment). Not compatible with Autogiro mandates.payment_late_failure_settled: Behaves the same as thepayment_late_failuresimulator, except that the late failure is additionally included as a debit item in a payout, thereby settling the late failure.payment_submitted: Transitions a payment tosubmitted, without proceeding any further. It must start in thepending_submissionstate.mandate_activated: Transitions a mandate through toactivated, having been submitted to the banks and set up successfully. It must start in thepending_submissionstate. Not compatible with ACH, BECS, BECS_NZ and SEPA mandates, which are submitted and activated with their first payment.mandate_customer_approval_granted: Transitions a mandate through topending_submission, as if the customer approved the mandate creation. It must start in thepending_customer_approvalstate. Compatible only with Bacs and SEPA mandates, which support customer signatures on the mandate. All payments associated with the mandate will be transitioned topending_submission. All subscriptions associated with the mandate will becomeactive.mandate_customer_approval_skipped: Transitions a mandate through topending_submission, as if the customer skipped the mandate approval during the mandate creation process. It must start in thepending_customer_approvalstate. Compatible only with Bacs and SEPA mandates, which support customer signatures on the mandate. All payments associated with the mandate will be transitioned topending_submission. All subscriptions associated with the mandate will becomeactive.mandate_failed: Transitions a mandate through tofailed, having been submitted to the banks but found to be invalid (for example due to invalid bank details). It must start in thepending_submissionorsubmittedstates. Not compatible with SEPA mandates, which are submitted with their first payment.mandate_expired: Transitions a mandate through toexpired, having been submitted to the banks, set up successfully and then expired because no collection attempts were made against it for longer than the scheme's dormancy period (13 months for Bacs, 3 years for SEPA, 15 months for ACH, Betalingsservice, and BECS). It must start in thepending_submissionstate. Not compatible with Autogiro, BECS NZ, and PAD mandates, which do not expire.mandate_transferred: Transitions a mandate through totransferred, having been submitted to the banks, set up successfully and then moved to a new bank account due. It must start in thepending_submissionstate. Only compatible with Bacs and SEPA mandates.mandate_transferred_with_resubmission: Transitions a mandate throughtransferredand resubmits it to the banks, can be caused be the UK's Current Account Switching Service (CASS) or when a customer contacts GoCardless to change their bank details. It must start in thepending_submissionstate. Only compatible with Bacs mandates.mandate_suspended_by_payer: Transitions a mandate tosuspended_by_payer, as if payer has suspended the mandate after it has been setup successfully. It must start in theactivatedstate. Only compatible with PAY_TO mandates.refund_paid: Transitions a refund topaid. It must start in either thepending_submissionorsubmittedstate.refund_settled: Transitions a refund topaid, if it's not already, then generates a payout that includes the refund, thereby settling the funds. It must start in one ofpending_submission,submittedorpaidstates.refund_bounced: Transitions a refund tobounced. It must start in either thepending_submission,submitted, orpaidstate.refund_returned: Transitions a refund torefund_returned. The refund must start inpending_submission.payout_bounced: Transitions a payout tobounced. It must start in thepaidstate.billing_request_fulfilled: Authorises the billing request, and then fulfils it. The billing request must be in thependingstate, with all actions completed except forbank_authorisation. Only billing requests with apayment_requestare supported.billing_request_fulfilled_and_payment_failed: Authorises the billing request, fulfils it, and moves the associated payment tofailed. The billing request must be in thependingstate, with all actions completed except forbank_authorisation. Only billing requests with apayment_requestare supported.billing_request_fulfilled_and_payment_confirmed_to_failed: Authorises the billing request, fulfils it, moves the associated payment toconfirmedand then moves it tofailed. The billing request must be in thependingstate, with all actions completed except forbank_authorisation. Only billing requests with apayment_requestare supported.billing_request_fulfilled_and_payment_paid_out: Authorises the billing request, fulfils it, and moves the associated payment topaid_out. The billing request must be in thependingstate, with all actions completed except forbank_authorisation. Only billing requests with apayment_requestare supported.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/gocardless_pro/services/scenario_simulators_service.rb', line 145 def run(identity, = {}) path = sub_url('/scenario_simulators/:identity/actions/run', { 'identity' => identity, }) params = .delete(:params) || {} [:params] = {} [:params]['data'] = params [:retry_failures] = false response = make_request(:post, path, ) return if response.body.nil? Resources::ScenarioSimulator.new(unenvelope_body(response.body), response) end |