arazzo: 1.0.1 info: title: Paystack Create Charge and Submit PIN summary: Create a direct card charge, branch when a PIN is required, submit the PIN, then check the final charge status. description: >- The PIN step of the Charge API's progressive authentication. A direct charge is created with the customer's card authorization; when Paystack responds that a PIN is required the workflow submits the PIN against the same reference and then checks the pending charge for its final status. A branch short-circuits to the status check when no PIN is needed. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: acceptPaymentsApi url: ../openapi/paystack-accept-payments-openapi.yml type: openapi workflows: - workflowId: charge-and-submit-pin summary: Charge a card, satisfy a PIN challenge, then read the final status. description: >- Creates a charge, branches on whether a PIN is required, submits the PIN, and checks the pending charge. inputs: type: object required: - email - amount - authorization_code - pin properties: email: type: string description: Customer's email address. amount: type: string description: Amount to charge in the smallest currency unit, as a string. authorization_code: type: string description: A non-reusable authorization code to charge. pin: type: string description: The customer's 4-digit card PIN. steps: - stepId: createCharge description: Create a direct charge against the card authorization, sending the PIN inline. operationId: charge_create requestBody: contentType: application/json payload: email: $inputs.email amount: $inputs.amount authorization_code: $inputs.authorization_code pin: $inputs.pin successCriteria: - condition: $statusCode == 201 outputs: reference: $response.body#/data/reference chargeStatus: $response.body#/data/status onSuccess: - name: pinRequired type: goto stepId: submitPin criteria: - context: $response.body condition: $.data.status == "send_pin" type: jsonpath - name: noPinNeeded type: goto stepId: checkCharge criteria: - context: $response.body condition: $.data.status != "send_pin" type: jsonpath - stepId: submitPin description: Submit the customer's PIN against the ongoing charge reference. operationId: charge_submitPin requestBody: contentType: application/json payload: pin: $inputs.pin reference: $steps.createCharge.outputs.reference successCriteria: - condition: $statusCode == 201 outputs: status: $response.body#/data/status - stepId: checkCharge description: Check the pending charge to read its final status. operationId: charge_check parameters: - name: reference in: path value: $steps.createCharge.outputs.reference successCriteria: - condition: $statusCode == 200 outputs: finalStatus: $response.body#/data/status outputs: reference: $steps.createCharge.outputs.reference finalStatus: $steps.checkCharge.outputs.finalStatus