# Cardholder-initiated Transaction scenario

Cardholder can initiate transaction using stored credentials. Below, decribes a possible scenario

  • # Step 1

    • Cardholder buy an item from your store for the first time and agrees to place their card on file with the merchant.
    • The cardholder performs a payment by entering full card details.
    • If the merchant is PCI SAQ-D Compliant, he can perform a full card payment else he should perform the payment using a payment-nonce.

Authorize a transaction using full card number

curl -X POST \
  https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
  -H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
  -H 'content-type: application/json' \
  -d '{
	"intent":"auth"
	,"payer":{
		"payment_type":"CC"
		,"funding_instrument":{
			"credit_card":{
				"number":"4005520201264821"
				,"expire_month":12
				,"expire_year":2020
				,"cvv2":"123"
				,"name":"Tom Hanks"
			}
		}
		,"payer_info":{
			"email":"TomHanks@gmail.com"
			,"billing_address":{
					"line1":"18 Avenue"
					,"line2":"cassidy"
					,"city":"Rose-Hill"
					,"country_code":"mu"
					,"postal_code":"72101"
					,"state":""
					,"phone":{
						"country_code":"230"
						,"number":"57976041"
					}
				}
		}
	}
	,"payee":{
		"email":"mail@test.com"
		,"merchant_id":"w3z8dfhkzvfq0j9n"
	}
	,"transaction":{
		"amount":{
			"currency":"USD"
			,"total":"300"
			,"details":{
				"subtotal":""
				,"shipping":""
			}
		}
		,"description":"purchase"
		,"items":[
			{
                "sku":"100299S"
                ,"name":"Ultrawatch"
                ,"description":"Smart watch"
                ,"quantity":"1"
                ,"price":"500"
                ,"shipping":"20"
                ,"currency":"USD"
                ,"url":""
                ,"image":""
                ,"tangible":"true"
			},
			{
                "sku":"100269S"
                ,"name":"Drone"
                ,"description":"drone x"
                ,"quantity":"1"
                ,"price":"500"
                ,"shipping":"20"
                ,"currency":"USD"
                ,"url":""
                ,"image":""
                ,"tangible":"true"
			}
		]
		,"shipping_address":{
			"recipient_name":"Tom Hanks"
		}
		,"soft_descriptor":{
			"text":"test.com"
			,"city":"london"
		}
		,"invoice_number":"123455"
	}
	,"custom":{
		
	},
	"capture_delay": 0.05,
	"metadata":{
		"CMS":"WooCommerce"
	}
}'

Successfull Response


{
    "id": "35ZQXK7H9YRD17JI6DNU",
    "reference_id": "35ZQXK7H9YRD17JI6DNU",
    "state": "authorised",
    "result": {
        "authorisation_code": "058607",
        "risk_check": true,
        "code": "0000"
    },
    "intent": "AUTH",
    "payer": {
        "payment_type": "CC",
        "funding_instrument": {
            "credit_card": {
                "id": "9c22d208-4e25-47f8-8d32-c0e6d97c17c2",
                "type": "Visa",
                "expire_month": 12,
                "expire_year": 2020,
                "name": "Tom Hanks",
                "cvv_check": "Y",
                "avs_check": "S",
                "last4": "4821",
                "bin": "400552",
				"is_default": true,
                "bin_data": {
                    "bin": "400552",
                    "country_code": "MU",
                    "country_name": "Mauritius",
                    "bank_name": "MCB",
                    "card_scheme": "Visa",
                    "card_type": "Credit",
                    "card_category": "1"
                }
            }
        },
        "payer_info": {
            "id": "0f053a05-9fa2-49a1-871f-3098e4b114e2",
            "email": "TomHanks@gmail.com",
            "name": "Tom Hanks",
            "billing_address": {
                "phone": {
                    "country_code": "230",
                    "number": "57976041"
                },
                "line1": "18 Avenue",
                "line2": "cassidy",
                "city": "Rose-Hill",
                "country_code": "MU",
                "postal_code": "72101",
                "state": ""
            }
        }
    },
    "transaction": {
        "amount": {
            "currency": "USD",
            "total": "300"
        },
        "type": "1",
        "mode": "1",
        "items": [
            {
                "sku": "100299S",
                "name": "Ultrawatch",
                "description": "Smart watch",
                "quantity": "1",
                "price": "500",
                "shipping": "",
                "url": ""
            },
            {
                "sku": "100269S",
                "name": "Drone",
                "description": "drone x",
                "quantity": "1",
                "price": "500",
                "shipping": "",
                "url": ""
            }
        ],
        "shipping_address": {
            "recipient_name": "Tom Hanks",
            "phone": {}
        },
        "invoice_number": "123455"
    },
    "custom": {},
    "delayed_capture_time": "2020-09-06T21:53:18Z",
    "create_time": "2020-09-06T21:50:18Z",
    "three_d": {}
}

  • # Step 2

    • For PCI SAQ-D merchants, they might choose to save the full card details on their servers.
    • For non PCI merchants, they might choose to save the Payer details and associated payer.funding_instrument.credit_card.id.
  • # Step 3

    • A cardholder return to the store and buy an item.

    • At checkout the merchant has the ability of proposing the cardholder to choose from either performing the payment using a saved card or by entering complete card details.

    • If the cardholder choose to use stored credentials:

      • The merchant is PCI SAQ-D and stores the card details on his own server. The merchant will perform a full card payment with the flag payer.funding_instrument.credit_card.stored: true set to true. (note that CVV is not stored and needs to be entered by the Payer)

Authorize a second payment using full card number

curl -X POST \
  https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
  -H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
  -H 'content-type: application/json' \
  -d '{
	"intent":"auth"
	,"payer":{
		"payment_type":"CC"
		,"funding_instrument":{
			"credit_card":{
				"number":"4005520201264821"
				,"expire_month":12
				,"expire_year":2020
				,"cvv2":"123"
				,"name":"Tom Hanks"
                ,"stored":true
			}
		}
		,"payer_info":{
			"email":"TomHanks@gmail.com"
			,"billing_address":{
					"line1":"18 Avenue"
					,"line2":"cassidy"
					,"city":"Rose-Hill"
					,"country_code":"mu"
					,"postal_code":"72101"
					,"state":""
					,"phone":{
						"country_code":"230"
						,"number":"57976041"
					}
				}
		}
	}
	,"payee":{
		"email":"mail@test.com"
		,"merchant_id":"w3z8dfhkzvfq0j9n"
	}
	,"transaction":{
		"amount":{
			"currency":"USD"
			,"total":"300"
			,"details":{
				"subtotal":""
				,"shipping":""
			}
		}
		,"description":"purchase"
		,"items":[
			{
                "sku":"100299S"
                ,"name":"Ultrawatch"
                ,"description":"Smart watch"
                ,"quantity":"1"
                ,"price":"500"
                ,"shipping":"20"
                ,"currency":"USD"
                ,"url":""
                ,"image":""
                ,"tangible":"true"
			},
			{
                "sku":"100269S"
                ,"name":"Drone"
                ,"description":"drone x"
                ,"quantity":"1"
                ,"price":"500"
                ,"shipping":"20"
                ,"currency":"USD"
                ,"url":""
                ,"image":""
                ,"tangible":"true"
			}
		]
		,"shipping_address":{
			"recipient_name":"Tom Hanks"
		}
		,"soft_descriptor":{
			"text":"test.com"
			,"city":"london"
		}
		,"invoice_number":"123455"
	}
	,"custom":{
		
	},
	"capture_delay": 0.05,
	"metadata":{
		"CMS":"WooCommerce"
	}
}'

  • The merchant is not PCI SAQ-D and uses our Vault to store credit card details. The merchant is able to retrieve list of cards associated to the Payer and display the same for selection

Retrieve payers associated cards


curl -X GET \
 https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payer/0f053a05-9fa2-49a1-871f-3098e4b114e2/card \
  -H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
  -H 'content-type: application/json' 
}

Response


    { 
        "count": 1,  
        "credit_cards": [{
            "id": "9c22d208-4e25-47f8-8d32-c0e6d97c17c2",
            "type": "Visa",
            "expire_month": 12,
            "expire_year": 2020,
            "name": "Tom Hanks",
            "cvv_check": "Y",
            "avs_check": "S",
            "last4": "4821",
            "bin": "400552",
            "is_default": true,
            "bin_data": {
                "bin": "400552",
                "country_code": "MU",
                "country_name": "Mauritius",
                "bank_name": "MCB",
                "card_scheme": "Visa",
                "card_type": "Credit",
                "card_category": "1"
            }
        }]   
    }

  • Once the cardholder select a card and enters the CVV, the merchant will be able to perform a payment using the credit_card_id of the selected card
curl -X POST \
  https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
  -H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
  -H 'content-type: application/json' \
  -d '{
	"intent":"auth"
	,"payer":{
		"payment_type":"CC"
		,"funding_instrument":{
			"credit_card_token":{
				"credit_card_id":"9c22d208-4e25-47f8-8d32-c0e6d97c17c2"
				,"cvv2":"123"			
			}
		}
		,"payer_info":{
			"email":"testclient@gmail.com"
			,"billing_address":{
					"line1":"18 Avenue"
					,"line2":"Test"
					,"city":"city name"
					,"country_code":"GB"
					,"postal_code":"W1 2"
					,"state":""
					,"phone":{
						"country_code":"+1"
						,"number":"0900099990"
					}
				}
		}
	}
	,"payee":{
		"email":"mail@merchantdomain.com"
		,"merchant_id":"w3z8dfhkzvfq0j9n"
	}
	,"transaction":{
		"amount":{
			"currency":"USD"
			,"total":"200.00"
			,"details":{
				"subtotal":""
				,"shipping":""
			}
		}
		,"description":"purchase"
		,"items":[
			{"sku":"100299S"
			,"name":"Ultrawatch"
			,"description":"Smart watch"
			,"quantity":"1"
			,"price":"110.00"
			,"shipping":"20"
			,"currency":"USD"
			,"url":""
			,"image":""
			,"tangible":"true"
			},
			{"sku":"100269S"
			,"name":"Drone"
			,"description":"drone x"
			,"quantity":"2"
			,"price":"45"
			,"shipping":"20"
			,"currency":"USD"
			,"url":""
			,"image":""
			,"tangible":"true"
			}
			]
		,"shipping_address":{
			"recipient_name":"Tom Hanks"
		}

		,"invoice_number":"123455"
	}
	,"custom":{
		"field1":"this is a test"
	}
}'

Last Updated: 8/29/2023, 12:45:13 PM